package com.yx.elastic.elasticcm.orm;

import java.util.List;

/**
 * Created by chenzp on 18-8-2.
 */
public class ElasORMClass {


    private Class eclass;
    /**
     * elastic 节点名称
     */
    private String index;
    /**
     * elastic 文档类型
     */
    private String type;
    /**
     * elastic 文档ID的名称
     */
    private String idName;
    /**
     * elastic id生成的类型
     */
    private EIdType idType;

    /**
     * id所属的class
     */
    private Class idClass;
    /**
     * 映射对象的id名称
     */
    private String ormIdName;
    /**
     * elastic 所有字段的类型的集合
     */
    private List<FieldAttr> attrs;

    /**
     * elastic 文档字段类型对象
     */
    static class FieldAttr{

        /**
         * elastic 字段名称
         */
        private String fieldName;
        /**
         * elastic 是否存在该文档
         */
        private boolean exit;

        /**
         * 映射对象的属性名称
         */
        private String ormFieldName;

        /**
         * elastic 字段值的策略
         */
        private EFieldStrategy strategy;

        /**
         * 属性归属的class
         */
        private Class attrClass;

        public Class getAttrClass() {
            return attrClass;
        }

        public void setAttrClass(Class attrClass) {
            this.attrClass = attrClass;
        }

        public String getFieldName() {
            return fieldName;
        }

        public void setFieldName(String fieldName) {
            this.fieldName = fieldName;
        }

        public boolean isExit() {
            return exit;
        }

        public void setExit(boolean exit) {
            this.exit = exit;
        }

        public EFieldStrategy getStrategy() {
            return strategy;
        }

        public void setStrategy(EFieldStrategy strategy) {
            this.strategy = strategy;
        }

        public String getOrmFieldName() {
            return ormFieldName;
        }

        public void setOrmFieldName(String ormFieldName) {
            this.ormFieldName = ormFieldName;
        }
    }


    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIdName() {
        return idName;
    }

    public void setIdName(String idName) {
        this.idName = idName;
    }

    public EIdType getIdType() {
        return idType;
    }

    public void setIdType(EIdType idType) {
        this.idType = idType;
    }

    public List<FieldAttr> getAttrs() {
        return attrs;
    }

    public void setAttrs(List<FieldAttr> attrs) {
        this.attrs = attrs;
    }

    public Class getEclass() {
        return eclass;
    }

    public void setEclass(Class eclass) {
        this.eclass = eclass;
    }

    public String getOrmIdName() {
        return ormIdName;
    }

    public void setOrmIdName(String ormIdName) {
        this.ormIdName = ormIdName;
    }

    public Class getIdClass() {
        return idClass;
    }

    public void setIdClass(Class idClass) {
        this.idClass = idClass;
    }
}
